#include <QApplication>
#include <QFile>
#include <QDebug>
#include <QTimer>
#include <QTreeView>

#include "qluascriptengine.h"
#include "qluascriptvalue.h"
#include "qluaglobal.h"
#include "qluascriptengineagent.h"
#include "qluascriptenginedebugger.h"
#include "qluaexception.h"

int main(int argc, char *argv[])
{
    QCoreApplication::setApplicationName("QLua Test");

    QApplication::setApplicationVersion("1.0");
    QApplication::setApplicationName("QtLua Test App");

    QApplication a(argc, argv);    

    QLuaScriptEngine * engine = new QLuaScriptEngine(&a);

    //QLuaScriptEngineDebugger * debugger = new QLuaScriptEngineDebugger(engine);

    //debugger->attachTo(engine);

    QWidget w;
    w.setWindowTitle("Test window");
    w.show();

    engine->setGlobal("app", engine->newQObject(&a));
    engine->setGlobal("window", engine->newQObject(&w));

    engine->executeFile("deploy/test.lua");

    return a.exec();
}
